#include "MainFrame/MenuBar/EditMenuList.h"
#include <QEvent>

EditMenuList::EditMenuList(const QString &title, QWidget *parent) :
    MenuListBase(title, parent),
    m_pUndoAction(nullptr),
    m_pRedoAction(nullptr)
{
    m_pUndoAction = addOneAction("Undo", this);
    m_pRedoAction = addOneAction("Redo", this);

    connect(m_pUndoAction, SIGNAL(triggered()), this, SLOT(undoSlot()));
    connect(m_pRedoAction, SIGNAL(triggered()), this, SLOT(redoSlot()));
}

EditMenuList::~EditMenuList()
{

}

void EditMenuList::changeEvent(QEvent *event)
{
    QWidget::changeEvent(event);
    switch (event->type())
    {
    case QEvent::LanguageChange:
        initTrans();
        break;
    default:
        break;
    }
}

void EditMenuList::initTrans()
{
    m_pUndoAction->setText(tr("Undo"));
    m_pRedoAction->setText(tr("Redo"));
}

void EditMenuList::undoSlot()
{

}

void EditMenuList::redoSlot()
{

}
